package com.observer2.gsj20150607;

import java.util.Observable;
import java.util.Observer;


public class CurrentDisplay implements Observer,Display{

	private Observable ob;
	private float temperature;

	public CurrentDisplay(Observable ob){
		this.ob = ob;
		ob.addObserver(this);
	}
	
	@Override
	public void display() {
		System.out.println("tem:"+temperature);
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		WeatherData wd = (WeatherData) arg0;
		this.temperature = wd.getTemperature();
		display();
		
	}

}
